import { Component, OnInit } from '@angular/core';
import { DefaultLanguageService } from '../../../../services/default-language.service';
import {TranslateService} from '@ngx-translate/core';
import { CommonService } from '@services/common-service.service';

@Component({
  selector: 'app-support-center',
  templateUrl: './support-center.page.html',
  styleUrls: ['./support-center.page.scss'],
})
export class SupportCenterPage implements OnInit {

  constructor(
    private defaultLanguageService:DefaultLanguageService,
    private translate:TranslateService,
    private commonService:CommonService) { }

  ngOnInit() {
    this.initLanguage();
  }

  initLanguage(){
    this.commonService.initTranslate([]); 
  }

  public questions:Array<any> = [
    {
      questionId:'1',
      questionStem:'How to set the payment password1?',
      answer:'Set the payment password in the payment Settings.Set the payment password in the payment Settings.Set the payment password in the payment Settings.',
      showAnswer:false
    },
    {
      questionId:'2',
      questionStem:'How to set the payment password2?',
      answer:'Set the payment password in the payment Settings.Set the payment password in the payment Settings.Set the payment password in the payment Settings.',
      showAnswer:false
    }
  ]

  showOrHideAnswer(question){
    if(!question.showAnswer){
      this.questions.forEach((item)=>{
        if(item.questionId == question.questionId){
          item.showAnswer = true;
        }else{
          item.showAnswer = false;
        }
      });
    }else{
      this.questions.forEach((item)=>{
        if(item.questionId == question.questionId){
          item.showAnswer = false;
        }
      });
    }
  }

}
